package main.java.day08;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 使用异常捕获完成下述操作
 * 将控制台输入的每一行字符串使用缓冲字符输出流PrintWriter
 * 按行以GBK编码写入到文件note.txt中
 * @author Xiloer
 *
 */
public class Test02 {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        String name=scanner.nextLine();
        PrintWriter printWriter = null;
        try {
            printWriter = new PrintWriter("note.txt");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        printWriter.write(name);
        printWriter.close();
    }
	
}
